home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 May / SGI IRIX 6.5 Complementary Applications 2004 May.iso / dist / OpenOffice.idb / usr / OpenOffice / help / en / sbasic.jar / text / sbasic / common / 03030205.xml < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-24  |  3.9 KB  |  42 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>TimeSerial Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03030205"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
  3.  
  4.         p.P1{
  5.                 }
  6.         p.P2{
  7.                 }
  8.         span.T1{
  9.                 font-weight:bold;}
  10.         </style></head><body>
  11.   
  12.   
  13.   <help:to-be-embedded Eid="timeserial" xmlns:help="http://openoffice.org/2000/help">
  14.   <p class="Head1"><help:link Id="66520">TimeSerial Function [Runtime]</help:link></p>
  15.   <p class="Paragraph">Calculates a serial time value from the specified hour, minute, and second - parameters passed as numeric values - that represents the time in a single numeric value. This value can be used to calculate the difference between times.</p>
  16.   </help:to-be-embedded>
  17.   <p class="Paragraph">See also: <help:link Id="66424" Eid="dateserial" xmlns:help="http://openoffice.org/2000/help">DateSerial Function</help:link>, <help:link Id="66550" Eid="timevalue" xmlns:help="http://openoffice.org/2000/help">TimeValue Function</help:link>, <help:link Id="66574" Eid="datevalue" xmlns:help="http://openoffice.org/2000/help">DateValue Function</help:link>.</p>
  18.   <p class="Paragraph"><span class="T1">Syntax</span>:</p>
  19.   <p class="Paragraph">TimeSerial (hour, minute, second) <help:key-word value="TimeSerial" tag="kw66520_1" xmlns:help="http://openoffice.org/2000/help"/></p>
  20.   <p class="Paragraph"><span class="T1">Return value</span>:</p>
  21.   <p class="Paragraph">Date</p>
  22.   <p class="Paragraph"><span class="T1">Parameter</span>:</p>
  23.   <p class="Paragraph">hour: Any integer expression that indicates the hour of the time, from which to determine the serial time value. Valid values: 0-23.</p>
  24.   <p class="Paragraph">minute: Any integer expression that indicates the minute of the time, from which to determine the serial time value. Normally you can use values between 0 and 59 here. However, values outside of this range are also possible. In this case the minute influences the hour.</p>
  25.   <p class="Paragraph">second: Any integer expression that indicates the second of the time, from which to determine the serial time value. Normally you can use values between 0 and 59 here. However, values outside of this range are also possible. In this case the second influences the minute.</p>
  26.   <p class="Paragraph">Examples:</p>
  27.   <p class="Paragraph">12, -5, 45 corresponds to 11, 55, 45</p>
  28.   <p class="Paragraph">12, 61, 45 corresponds to 13, 2, 45</p>
  29.   <p class="Paragraph">12, 20, -2 corresponds to 12, 19, 58</p>
  30.   <p class="Paragraph">12, 20, 63 corresponds to 12, 21, 4</p>
  31.   <p class="Paragraph">With this function, you can convert any time into a single value, with which you can calculate time differences.</p>
  32.   <p class="Paragraph">The TimeSerial function returns the type Variant with VarType 7 (Date); this value is stored internally as a double-precision number between 0 and 0.9999999999. As opposed to the DateSerial or DateValue function, in which serial date values are calculated resulting in days relative to a fixed date, you can calculate with values returned by the TimeSerial function, but you cannot evaluate them.</p>
  33.   <p class="Paragraph">In the TimeValue function, you can pass a string as a parameter containing the time. For the TimeSerial function, however, you can pass the individual parameters (hour, minute, second) as separate numeric expressions.</p>
  34.   <p class="P2">Example:</p>
  35.   <p class="PropText">Sub ExampleTimeSerial</p>
  36.   <p class="PropText">Dim dDate As Double, sDate As String</p>
  37.   <p class="PropText">dDate = TimeSerial(8,30,15)</p>
  38.   <p class="PropText">sDate = TimeSerial(8,30,15)</p>
  39.   <p class="PropText">MsgBox dDate,64,"Time as a number"</p>
  40.   <p class="PropText">MsgBox sDate,64,"Formatted time"</p>
  41.   <p class="PropText">End Sub</p>
  42.  </body></html>